<?php

use magein\migration\PhinxConfig;
use think\facade\Env;

return PhinxConfig::config(
    [
        'paths' => [
            'migrations' => root_path('database/migrations'),
            'seeds' => root_path('database/seeds')
        ],
        'templates' => [
            'file' => PhinxConfig::template()
        ],
        'version_order' => 'creation',
        'environments' => [
            'default_migration_table' => 'phinx_log',
            'default_environment' => 'development',
            'development' => [
                'adapter' => Env::get('DB_TYPE', 'mysql'),
                'host' => Env::get('DB_HOST', '127.0.0.1'),
                'name' => Env::get('DB_NAME', ''),
                'user' => Env::get('DB_USER', 'root'),
                'pass' => Env::get('DB_PASS', ''),
                'port' => Env::get('DB_PORT', '3306'),
                'charset' => Env::get('DB_CHARSET', 'utf8mb4'),
                'collation' => Env::get('DB_CHARSET_COLLATION', 'utf8mb4_unicode_ci'),
            ],
        ],
    ]
);